import { createSlice } from '@reduxjs/toolkit'

const counterSlice = createSlice({
  name: 'counter',
  initialState: {
    count: 1,
  },
  reducers: {
    add(state, action) {
      state.count += action.payload
    },
    minus(state, action) {
      state.count -= action.payload
    },
  },
})

export default counterSlice.reducer
